from keras.utils import image_dataset_from_directory


train_dir = '/Users/summy/Downloads/dataset-resized'


if __name__ == '__main__':
	dataset = image_dataset_from_directory(
		train_dir,
		labels='inferred',
		label_mode='int',  # 标签编码
		validation_split=0.2,  # 验证集比例为20%
		subset='training',  # 处理后得到的数据为训练集
		seed=123,
		# class_names=
		shuffle=True,
		color_mode='rgb',
		batch_size=8,
	)
	
	for d in dataset:
		print(d)
		break
